<!---
	Title:		EPAR1.1 
	Author:		Bruce Frick
	Purpose:	index page
--->

<cfset BASE = CreateObject("component", "#session.rootDir#.cfc.base") />
<cfset mainQueries = CreateObject("component", "#session.rootDir#.cfc.queries") />
<cfinclude template="/code_lib/SCF_Employee.cfm">
<cfinclude template="/code_lib/SCF_HR.cfm">
<cfinclude template="/code_lib/SCF_REGEX.cfm">

<cfoutput>
<!---HTML header, css links, js links, and page title--->
#BASE.htmlTerminationHeader(
	"/jquery/ui-1.8.5/jquery-ui.min.js,../js/Step1-RequestTermination.js", <!---JS links--->
    "/jquery/ui-1.8.5/themes/cupertino/jquery-ui.css", <!---CSS links--->
    "Step 1:  Manager Termination Request", <!---Page Title--->
    "Status" <!---Active Nav Link--->
)#
<!---HTML header, css links, js links, and page title--->


<cfif Session.bolAuth EQ True and (Session.strAuthType EQ Session.MANAGERS or Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR)>
    
    <cfset LOCALS.TermReqID = -1>
    
	<cfset QUERIES = {
		GetTermTypes = CreateObject("component", "#session.rootDir#.cfc.queries").funcGetPersonCodes('TT'),
		GetES = CreateObject("component", "#session.rootDir#.cfc.queries").funcGetPersonCodes('ES'),
		GetRC = CreateObject("component", "#session.rootDir#.cfc.queries").funcGetReasonCodes('ES'),
        GetFilePath = CreateObject("component", "#session.rootDir#.cfc.queries").funcGetFilePath(),
        GetFileTypes = CreateObject("component", "#session.rootDir#.cfc.queries").funcGetFileTypes(2),
        GetFiles = CreateObject("component", "#session.rootDir#.cfc.queries").funcGetFiles(LOCALS.TermReqID),
        GetFilePath = CreateObject("component", "#session.rootDir#.cfc.queries").funcGetFilePath()
    } />
    
    <cfquery name="QUERIES.GetEmpStatus" dbtype="query">
        Select * 
        From QUERIES.GetES
        Where PersonCodeIDNo in (-10133, -10132)
	</cfquery>
    
    <cfquery name="QUERIES.GetESReasonCodes" dbtype="query">
         Select * 
         From QUERIES.GetRC
        Where ReasonCodeIDNo not in (3,5,6,56)
 	</cfquery>
    
    <h1 class="title">Step 1:  Termination Request</h1>
    <div class="entry">    
         Welcome, #Session.arrEmpInfo.FirstName# #Session.arrEmpInfo.LastName#.  
         In this step, we'll capture information necessary to initiate the request for termination of an employee: 
         <br /><br />
        <div class="notes">

        </div>
                 
        <cfform name="frmStep1" method="post" action="api.cfm?api=step1Termination_insert" enctype='multipart/form-data'>
            <table width = 100%>
                <tr>
                    <td width =20%>Employee:</td>
                    <td>
                        #SCF_Employee_ShowDropdown_AllEmployees('RosettaID', 0, 1, False, True, True, 10, "", false, "", true)#              
                    </td>
                </tr>
                <tr>
                    <td>Termination Type:</td>
                    <td>
                        <cfselect name="TermTypeID" query="QUERIES.GetTermTypes" tabindex="20" value="PersonCodeIDNo" display="PersonCode" selected="0" />
                    </td>
                </tr>
                <tr>
                    <td>Employee Status:</td>
                    <td>                     	
                        <cfselect name="EmpStatusIDNo" query="QUERIES.GetEmpStatus" tabindex="30" value="PersonCodeIDNo" display="PersonCode" selected="-10133" />
                    </td>
                </tr>
                <tr>
                    <td nowrap="nowrap">Employment Status Reason:</td>
                    <td>                      	
                        <cfselect name="EmpStatusReasonCode" query="QUERIES.GetESReasonCodes" tabindex="40" value="ReasonCodeIDNo" display="ReasonCode" selected="0" />
                    </td>
                </tr>
                
                <tr>
                    <td nowrap="nowrap" valign="top">Letter of Resignation:</td>
                    <td>
                        <cfinput type="file" name="FileUpload" error_message="Please specify the file to upload." style="width:100%"> 
                        <cfinput type="hidden" name="FileTypeID" value="8" /> <!--- Letter of Resignation is id 8 --->
                        <cfinput type="hidden" name="Directory" value="#QUERIES.GetFilePath.Directory#" />
                    </td>
                </tr>            
                
                <tr>
                    <td valign="top">Termination Date: <BR /></td>
                    <td>
                        <div id="DateOfTermination_datepicker"></div>
                        <cfinput type="hidden" name="Term" value="#dateformat(now(),'mm/dd/yyyy')#" />
                    </td>
                </tr>
                
                
                <TR>
                    <TD valign="top">Comments:</TD>
                    <TD colspan=3>
                        <cftextarea rows="2" tabindex="70" name="Comments" style="width:99%" value="" />
                    </TD>
                </TR>
                <tr>
                    <td>&nbsp;
                        
                    </td>
                </tr>
                <tr>
                    <td colspan="5" align="right">
                        <cfinput type="button" name="Submit" value="Next >>" tabindex="80">
                    </td>
                </tr>
            </table>
        </cfform>
    
    </div>

<cfelse>
    <cfinclude template="../denied.cfm">
</cfif>


<!---HTML footer, closes html and body tags.  Any footer info goes here--->
#BASE.htmlTerminationFooter()#
<!---HTML footer, closes html and body tags.  Any footer info goes here--->
</cfoutput>